﻿<Window x:Class="TicketServer.SettingsWindow"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:eT="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit.Extended"
		xmlns:lex="http://wpflocalizeextension.codeplex.com"
		xmlns:p="clr-namespace:TicketServer.Client.Properties"
		lex:LocalizeDictionary.DesignCulture="en"
		lex:ResxLocalizationProvider.DefaultAssembly="TicketServer.Client"
		lex:ResxLocalizationProvider.DefaultDictionary="Resources"
		Title="{lex:LocText Settings}"
		Width="480"
		Height="280"
		Closed="Window_Closed"
		Icon="Icons/Small/settings.png"
		ResizeMode="NoResize"
		ShowInTaskbar="False"
		WindowStartupLocation="CenterOwner"
		WindowStyle="SingleBorderWindow">
	<Grid>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="140" />
			<ColumnDefinition />
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition />
			<RowDefinition Height="34" />
		</Grid.RowDefinitions>

		<ListBox x:Name="listBoxPage"
				 Grid.Row="0"
				 Grid.Column="0"
				 Margin="5"
				 SelectionChanged="listBoxPage_SelectionChanged">
			<ListBoxItem IsSelected="True">
				<StackPanel Margin="0 2" Orientation="Horizontal">
					<Image Width="24" Source="Icons\Medium\gear.png" />
					<TextBlock Margin="5 0 0 0"
							   VerticalAlignment="Center"
							   Text="{lex:LocText General}" />
				</StackPanel>
			</ListBoxItem>
			<ListBoxItem>
				<StackPanel Margin="0 2" Orientation="Horizontal">
					<Image Width="24" Source="Icons\Medium\networksettings.png" />
					<TextBlock Margin="5 0 0 0"
							   VerticalAlignment="Center"
							   Text="{lex:LocText Server}" />
				</StackPanel>
			</ListBoxItem>
		</ListBox>

		<TabControl x:Name="tabControlSettings"
					Grid.Row="0"
					Grid.Column="1"
					Margin="5 3 5 5">
			<TabItem Visibility="Collapsed">
				<Grid>
					<Grid.RowDefinitions>
						<RowDefinition Height="28" />
						<RowDefinition Height="28" />
						<RowDefinition Height="28" />
						<RowDefinition Height="28" />
						<RowDefinition Height="28" />
						<RowDefinition Height="28" />
						<RowDefinition Height="Auto" />
					</Grid.RowDefinitions>
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="Auto" />
						<ColumnDefinition />
					</Grid.ColumnDefinitions>

					<TextBlock Text="{lex:LocText AutoRedeem}" Grid.Column="0" Grid.Row="0" Margin="3" VerticalAlignment="Center" />
					<CheckBox Grid.Column="1" Grid.Row="0" VerticalAlignment="Center" Margin="3" IsChecked="{Binding AutoRedeem, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />

					<TextBlock Text="{lex:LocText TimeToRedeem}" Grid.Column="0" Grid.Row="1" Margin="3" VerticalAlignment="Center" />
					<eT:ButtonSpinner Grid.Row="1"
									  Grid.Column="1"
									  Margin="3"
									  Spin="ButtonSpinner_Spin">
						<TextBox Text="{Binding SecondsToAutoRedeem, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />
					</eT:ButtonSpinner>

					<TextBlock Text="{lex:LocText AutoFocusInterval}" Grid.Column="0" Grid.Row="2" Margin="3" VerticalAlignment="Center" />
					<eT:ButtonSpinner Grid.Row="2"
									  Grid.Column="1"
									  Margin="3"
									  Spin="ButtonSpinner_Spin">
						<TextBox Text="{Binding AutoFocusInterval, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />
					</eT:ButtonSpinner>

					<TextBlock Text="{lex:LocText BeepCount}" Grid.Column="0" Grid.Row="3" Margin="3" VerticalAlignment="Center" />
					<eT:ButtonSpinner Grid.Row="3"
									  Grid.Column="1"
									  Margin="3"
									  Spin="ButtonSpinner_Spin">
						<TextBox Text="{Binding BeepCount, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />
					</eT:ButtonSpinner>

					<TextBlock Text="{lex:LocText BeepDuration}" Grid.Column="0" Grid.Row="4" Margin="3" VerticalAlignment="Center" />
					<eT:ButtonSpinner Grid.Row="4"
									  Grid.Column="1"
									  Margin="3"
									  Spin="ButtonSpinner_Spin">
						<TextBox Text="{Binding BeepDuration, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />
					</eT:ButtonSpinner>

					<TextBlock Text="{lex:LocText BeepPause}" Grid.Column="0" Grid.Row="5" Margin="3" VerticalAlignment="Center" />
					<eT:ButtonSpinner Grid.Row="5"
									  Grid.Column="1"
									  Margin="3"
									  Spin="ButtonSpinner_Spin">
						<TextBox Text="{Binding BeepPause, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />
					</eT:ButtonSpinner>
				</Grid>
			</TabItem>
			<TabItem Visibility="Collapsed">
				<Grid>
					<Grid.RowDefinitions>
						<RowDefinition Height="28" />
						<RowDefinition Height="Auto" />
					</Grid.RowDefinitions>
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="Auto" />
						<ColumnDefinition />
					</Grid.ColumnDefinitions>

					<TextBlock Text="{lex:LocText ServiceURI}" Grid.Column="0" Grid.Row="0" Margin="3" VerticalAlignment="Center" />
					<TextBox x:Name="textBoxServiceURI" 
							 Grid.Column="1" Grid.Row="0" Margin="3"
							 Text="{Binding ServiceURI, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />

					<TextBlock Grid.Row="1"
							           Grid.Column="1"
							           Grid.ColumnSpan="2"
							           FontSize="10"
							           FontWeight="Normal"
							           Text="{lex:LocText ServiceURIDesciption}" />
				</Grid>
			</TabItem>
		</TabControl>

		<StackPanel Grid.Row="1"
					Grid.Column="1"
					HorizontalAlignment="Right"
					Orientation="Horizontal">
			<Button x:Name="buttonSave"
					Width="100"
					Margin="5"
					Click="buttonSave_Click"
					Content="{lex:LocText Save}" />
			<Button x:Name="buttonCancel"
					Width="100"
					Margin="5"
					Click="buttonCancel_Click"
					Content="{lex:LocText Cancel}" />
		</StackPanel>
	</Grid>
</Window>
